﻿using Abp.Dependency;
using Hangfire;
using Hangfire.Annotations;
using Microsoft.AspNetCore.Builder;

namespace Hicap.AuthorizationServer.Core.Extensions
{
    public static class WindsorJobActivatorExtension
    {
        public static IApplicationBuilder UseHangfireWindsorJobActivator([NotNull] this IApplicationBuilder app)
        {
            JobActivator.Current = new WindsorJobActivator(IocManager.Instance.IocContainer.Kernel);

            return app;
        }
    }
}